package com.linq.cool.api.feign;

import com.linq.cool.api.domain.SysLoginLog;
import com.linq.cool.api.domain.SysOperateLog;
import com.linq.cool.api.factory.RemoteSysLogFallbackFactory;
import com.linq.cool.common.constants.ServiceNameConstants;
import com.linq.cool.common.core.domain.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: yqlin
 * @Date: 2020/12/29 17:18
 * @Description: 日志服务
 * @Version: 1.0.0
 */
@FeignClient(contextId = "remoteSysLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSysLogFallbackFactory.class)
public interface RemoteSysLogService {
    /**
     * 保存系统操作日志
     *
     * @param operateLog 日志实体
     * @return 结果
     */
    @PostMapping("/operateLog")
    Result<?> saveOperateLog(@RequestBody SysOperateLog operateLog);

    /**
     * 保存访问记录
     *
     * @return 结果
     */
    @PostMapping("/loginLog")
    Result<?> saveLoginLog(@RequestBody SysLoginLog loginLog);
}
